import base64


cer = open('aaa010101aaa_csd_08.cer').read().replace('/n', '')
certificado = base64.b64encode(cer)

print " \nCertificado(.cer) :\n", certificado

